package ernie.server.context;

import java.io.IOException;

import misc.HTMLStringStream;
import misc.HTTP;

import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;

import ernie.pages.Error404Page;
import ernie.pages.Page;

/**
 * @author Filip Lindqvist <buggfille@gmail.com>
 * @created 11:21:46 AM - Nov 16, 2011
 */
public class BlockingContext implements HttpHandler {
    @Override
    public void handle(HttpExchange t) {
        try {
            HTMLStringStream hss = new HTMLStringStream(t, HTTP.OK);
            Page p = new Error404Page();
            hss.write(p.getContent());
            hss.close();
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
    }
}
